;(function () {
  // gameBox.style.display="none";
  window.__startGame = function () {

    var winWidth = window.innerWidth * 2;
    var winHeight = window.innerHeight * 2;
    // 创建游戏实例
    window.game = new Phaser.Game(winWidth,
      winHeight,
      Phaser.AUTO, 'game');

    let Preload = require("../modules/preload");
    let Gaming = require("../modules/gaming");
    let Playing = require("../modules/playing");
    let Over = require("../modules/over");
    // let DicePlay=require("../modules/dicePlay");
    // let Over=require("../modules/over");
    
    let routers = {
      Preload,
      Gaming,
      Playing,
      Over
    }
    Object.keys(routers).forEach(v => {
      let obj = new routers[v]();
      game.state.add(v, routers[v]);
    })
    game.state.start('Preload');
  }
  window.__gameFinished = function () {

  }
})();
